package com.mk.magic_c.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mk.magic_c.dto.DiscussPostHomeVo;
import com.mk.magic_c.mapper.DiscussPostMapper;
import com.mk.magic_c.model.DiscussPost;
import com.mk.magic_c.service.DiscussPostService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author Magic Kong
 * @since 2021-10-02
 */
@Service
public class DiscussPostServiceImpl extends ServiceImpl<DiscussPostMapper, DiscussPost> implements DiscussPostService {


    /**
     * 自定义sql分页参考：https://blog.csdn.net/weixin_42030357/article/details/113946825
     */
    @Override
    public Page<DiscussPostHomeVo> listHomePost(long current, long size) {
        Page<DiscussPostHomeVo> page = new Page<>(current, size);
        baseMapper.listHomePost(page);
        return page;
    }
}
